package com.sa35.fbs.model;

import java.util.HashMap;
import java.util.Map;

public enum BookingStatusEnum {
	BOOKED(1,"Booked"),
	UPDATED(2,"Updated"), 
	DELETED(3,"Deleted"), 
	APPROVED(4,"Approved"), 
	REJECTED(5, "Rejected"), 
	CANCELLED(6, "Cancelled");
	
	private Integer value;
	private String display;
	
	private BookingStatusEnum(Integer value, String display){
		this.value = value;
		this.display = display;
	}
	
	private static Map<Integer,BookingStatusEnum> valueMap = new HashMap<Integer,BookingStatusEnum>();
	static{
		for(BookingStatusEnum b : values()){
			valueMap.put(b.value,b);
		}
	}
	
	@Override
	public String toString(){
		return display;
	}
	
	public Integer getValue(){
		return value;
	}
	
	public static BookingStatusEnum lookup(Integer key) throws IllegalArgumentException {
        if(key==null)
            return null;
        else if(!valueMap.containsKey(key))
            throw new IllegalArgumentException("Can not find enum member: " + key);
        return valueMap.get(key);
    }
}
